<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title></title>
    <style>
        * {
          margin: 0;
          padding: 0;
        }
        html, body {
          overflow: hidden;
        }
    </style>
    <script src="../EasyPlayer-element.min.js"></script>
    <script src="../EasyPlayer-lib.min.js"></script>
    <script>
      function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
          var pair = vars[i].split("=");
          if(pair[0] == variable){return pair[1];}
        }
        return(false);
      }

      function init() {
        // var url = 'http://1011.hlsplay.aodianyun.com/demo/game.flv'
        var url = getQueryVariable('url')
        if (url == '' || url == undefined || url == null) {
          alert('未找到url参数')
          return
        }
        var player = document.getElementById('player');
        const container = player.getBoundingClientRect() 
        console.log(player, container, container.width / container.height);
        player.setAttribute('video-url', decodeURIComponent(url));
      }
    </script>
  </head>
  <body style="background-color: rgba(0, 0, 0, 0.3)" onload="init()">
    <easy-player
      id="player"
      style="width:100%;height:auto"
      fluent
      :autoplay="autoPlay"
      live
      decodeWasm="false"
      muted="true"
    >
    </easy-player>
  </body>
</html>
